using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;

namespace Astro.Core
{
	/// <summary>
	/// Defines a single custom form. This object is stored in the ObjectStore
	/// </summary>
	[Serializable]
    public class CustomUserFormSettings : CustomFormSettings
	{
		public static readonly string DefaultCustomFormName = "Default::Custom::User::Form";

        public static CustomUserFormSettings Get()
		{
			CustomUserFormSettings cfs = ObjectManager.Get<CustomUserFormSettings>(DefaultCustomFormName);

			return cfs;
		}

        public void Save()
        {
            if (string.IsNullOrEmpty(Name))
                throw new Exception("The name of the custom user form cannot be null");

            ObjectManager.Save(this, DefaultCustomFormName);
        }
	}
}